<?php

namespace app\admin\service;

use app\admin\model\ActionLog;

/**
 * 登录日志-服务类
 * Class LoginLogService
 * @package app\admin\service
 */
class LoginLogService extends BaseService
{
    /**
     * 构造函数
     *
     * LoginLogService constructor.
     */
    public function __construct()
    {
        $this->model = new ActionLog();
    }

    /**
     * 获取登录日志列表
     * @return array
     *
     */
    public function getList()
    {
        $param = request()->param();
        // 查询条件
        $map = [];

        // 只取登录日志
        $map[] = ['type', "<=", 2];

        // 用户账号
        $username = getter($param, "username");
        if ($username) {
            $map[] = ["username", "=", $username];
        }
        return parent::getList($map); // TODO: Change the autogenerated stub
    }

}